#ifndef __THREADPOOL_H__
#define __THREADPOOL_H__
#include "TaskQenen.h"
#include <vector>
#include <memory>
#include "Task.h"
#include"Thread.h"
using std::unique_ptr;
using std::endl;
using std::cout;
using std::vector;
class ThreadPool{

public:
    ThreadPool(size_t thsize,size_t tasksize);
    ~ThreadPool();
    void start();
    void stop();
    void addTask(Task*pstask);
    void doTask();
    Task*getTask();
private:
    size_t _thidSize;
    size_t _taskSize;
    TaskQueue _que;
    bool isRuning;
    void wake();
    vector<unique_ptr<Thread>> _threads;
};
#endif